package com.onlyyou.user.util;

import com.onlyyou.user.VO.ResultVO;
import com.onlyyou.user.enums.ResultEnum;

/**
 * @Author: 小野
 * @Date: 2020/1/12 17:22
 */
public class ResultUtil {
    public static ResultVO error(Integer code, String msg) {
        return new ResultVO(code,msg,null);
    }

    public static ResultVO success(Object data) {
        return new ResultVO(200,"ok",data);
    }
    public static ResultVO success() {
        return success(null);
    }
    public static ResultVO unAuthorized() {
        return new ResultVO(401,"未授权",null);
    }

    public static ResultVO noLogin() {
        return new ResultVO(ResultEnum.NO_LOGIN,null);
    }

}
